package com.qlu.casualtalk.constant;

// 正则表达式
public class RegexConstant {

    // 账号: 4-16位的字母、数字、下划线或横线组成
    public static final String ACCOUNT_REGEX = "^[a-zA-Z0-9_-]{4,16}$";

    // 密码: 6-16位的字母、数字、下划线或横线组成
    public static final String PASSWORD_REGEX = "^[a-zA-Z0-9_-]{6,16}$";

    // 昵称: 2-6汉字或2-12英文字母
    public static final String NICKNAME_REGEX = "^[\\u4e00-\\u9fa5]{2,6}|[a-zA-Z]{2,12}$";

    // 手机号：1开头，第二位为3-9，后面9位数字，或者是空字符串
    public static final String PHONE_REGEX = "^1[3-9]\\d{9}$|^$";
    //public static final String PHONE_REGEX = "^1[3-9]\\d{9}$";

    //性别：男或女 male female，或者空字符串
    public static final String SEX_REGEX = "^(男|女|)$";
    //public static final String SEX_REGEX = "^(男|女)$";

    //邮箱: 匹配邮箱格式，或者空字符串
    public static final String EMAIL_REGEX = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$|^$";
    //public static final String EMAIL_REGEX = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
}
